import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  {
    path: '/',
    name: '首页',
    component: () => import('@/views/home')
  }
];

export function setupRouter() {
  const base = window.__MICRO_APP_BASE_ROUTE__ || process.env.BASE_URL;
  const history = createWebHistory(base);
  const router = createRouter({
    history,
    routes
  });

  return {
    history,
    router
  };
}
